package com.greyu.ysj.mapper;


import com.greyu.ysj.entity.CbtInvest;
import com.greyu.ysj.entity.CbtInvestExample;
import com.greyu.ysj.utils.InvestFlag;

import java.util.Date;
import java.util.List;



import org.apache.ibatis.annotations.Param;

public interface CbtInvestMapper {
    long countByExample(CbtInvestExample example);

    int deleteByExample(CbtInvestExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(CbtInvest record);

    int insertSelective(CbtInvest record);

    List<CbtInvest> selectByExample(CbtInvestExample example);

    CbtInvest selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") CbtInvest record, @Param("example") CbtInvestExample example);

    int updateByExample(@Param("record") CbtInvest record, @Param("example") CbtInvestExample example);

    int updateByPrimaryKeySelective(CbtInvest record);

    int updateByPrimaryKey(CbtInvest record);
    //*******************************************
    List<CbtInvest> selectByuserId(Integer userId);
    
    List<CbtInvest> selectInvestRecordByuserId(Integer userId);
    
    int countInvestListByuserId(Integer userId);
    
    List<CbtInvest> selectAllInvestList();
    
    List<CbtInvest> selectAllList();
    
    List<CbtInvest> selectAllYesterdayInvestList();
    
    int countTotalInvestByuserId(int userId);
    //用户有效存单---未到期，未提取
    List<CbtInvest> selectInvestsByuserId(Integer userId);
    
    int countRealInvestsByuserId(int userId);
    
    List<CbtInvest> selectYesterdayInvestByuserId(Integer userId);
    
  //获取当前用户的所有的投资额度
    double selectTotalInvestByuserId(Integer userId);
    
  //获取当前用户所有参与返还的用户投资额度
    double selectTotalUnExtractInvestByuserId(Integer userId);
    double selectAllNoInvestByuserId(Integer userId);
    double selectAllPriceByuserId(Integer userId);
    int updateBatch(List<InvestFlag> records);
    
	 double selectTotalRewardByuserId(@Param("userId")Integer userId,@Param("list")List<Integer> list);
	 double selectYesterdayRewardByuserId(@Param("userId")Integer userId,@Param("list")List<Integer> list);
	 
	 List<CbtInvest> selectAllInvestListByuserId(@Param("userId")Integer userId,@Param("list")List<Integer> list);
	 
	 double allInvest(@Param("coinId")Integer coinId,@Param("startTime")Date startTIme, @Param("endTime")Date endTime);
      
}